package com.yst.shader.ext

import android.graphics.Rect
import android.view.MotionEvent
import android.view.MotionEvent.ACTION_HOVER_ENTER
import android.view.View

private val rect = Rect()
private val intoArray = intArrayOf(0, 0)

fun View.locationInfo() {
    this.getLocationOnScreen(intoArray)
    println("location screen ${intoArray.contentToString()}")
    this.getLocationInWindow(intoArray)
    println("location window ${intoArray.contentToString()}")
    this.getLocalVisibleRect(rect)
    println("location visible $rect")
    this.getDrawingRect(rect)
    println("location getDrawingRect $rect")
    this.getFocusedRect(rect)
    println("location getFocusedRect $rect")
    this.getGlobalVisibleRect(rect)
    println("location getGlobalVisibleRect $rect")

}


fun View.pointOnScreen(): IntArray {
    this.getLocationOnScreen(intoArray)
    return intoArray.copyOf()

}


